import requests



class Config:

    def __init__(self,url):
        self.url = url
        self.session = requests.session()

    def post(self,url,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == "data":
            return requests.post(url,data=data,headers=headers)
        elif status == "json":
            return requests.post(url,json=data,headers=headers)
        else:
            return requests.post(url,params=data,headers=headers)

    def get(self,url,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == "data":
            return requests.get(url,data=data,headers=headers)
        elif status == "json":
            return requests.get(url,json=data,headers=headers)
        else:
            return requests.get(url,params=data,headers=headers)

    def put(self,url,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == "data":
            return requests.put(url,data=data,headers=headers)
        elif status == "json":
            return requests.put(url,json=data,headers=headers)
        else:
            return requests.put(url,params=data,headers=headers)

    def delete(self,url,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == "data":
            return requests.delete(url,data=data,headers=headers)
        elif status == "json":
            return requests.delete(url,json=data,headers=headers)
        else:
            return requests.delete(url,params=data,headers=headers)
